<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>考勤结果管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
	$(document).ready(function() {
		$("#btnExport").click(function(){
			top.$.jBox.confirm("确认要导出考勤统计数据吗？","系统提示",function(v,h,f){
				if(v=="ok"){
					$("#searchForm").attr("action","${ctx}/employee/attendanceRecords/export");
					$("#searchForm").submit();
				}
			},{buttonsFocus:1});
			top.$('.jbox-body .jbox-icon').css('top','55px');
		});
	});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/employee/attendanceRecords/list">考勤结果列表</a></li>
		<shiro:hasPermission name="employee:attendanceRecords:edit"><li><a href="${ctx}/employee/attendanceRecords/form">考勤结果添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="attendanceRecords" action="${ctx}/employee/attendanceRecords/list" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden"  value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden"  value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>员工编号：</label>
				<form:input path="employeenumber" htmlEscape="false" maxlength="100" class="input-medium"/>
			</li>
			<li><label>员工名称：</label>
				<form:input path="name" htmlEscape="false" maxlength="100" class="input-medium"/>
			</li>
			<li><label>国家：</label>
				<sys:treeselect id="company" name="company" value="${attendanceRecords.company.id}" labelName="${attendanceRecords.company.name}" labelValue="${attendanceRecords.company.name}"
					title="仓库" url="/sys/office/treeData?type=1" cssClass="input-small" allowClear="true" notAllowSelectParent="true"/>
			</li>
			<li><label>仓库：</label>
				<sys:treeselect id="office" name="office" value="${attendanceRecords.office.id}" labelName="${attendanceRecords.office.name}" labelValue="${attendanceRecords.office.name}"
					title="仓库" url="/sys/office/treeData?type=2" cssClass="input-small" allowClear="true" notAllowSelectParent="true"/>
			</li>
			
			<li><label>考勤日期：</label>
				<input name="startTime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
					value="<fmt:formatDate value="${attendanceRecords.startTime}" pattern="yyyy-MM-dd"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
					
				<input name="endTime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
				value="<fmt:formatDate value="${attendanceRecords.endTime}" pattern="yyyy-MM-dd"/>"
				onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
			</li>			
			<li class="btns">
				<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
				<input id="btnExport" class="btn btn-primary" type="button" value="导出"/>
			</li>

			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>				
				<th>员工编号</th>
				<th>员工姓名</th>
				<th>国家</th>
				<th>仓库</th>
				<th>职位</th>
				<th>班次</th>
				<th>考勤日期</th>
				<th>出勤工时</th>
				<th>假期工时</th>
				<th>休息时长</th>
				<th>迟到</th>
				<th>早退</th>
				<th>打卡异常</th>
				<th>旷工</th>
				<th>修改时间</th>
				<th>备注</th>
				<shiro:hasPermission name="employee:attendanceRecords:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="attendanceRecords">
			<tr>
				<td>${attendanceRecords.employeenumber}</td>
				<td>
					${attendanceRecords.name}
				</td>
				<td>${attendanceRecords.company.name}</td>
				<td>${attendanceRecords.office.name}</td>	
				<td>${attendanceRecords.position}</td>
				<td>${attendanceRecords.shiftName}</td>
				<td>
					<fmt:formatDate value="${attendanceRecords.attendanceDate}" pattern="yyyy-MM-dd"/>				
				</td>
				<td>${attendanceRecords.workHour}</td>
				<td>${attendanceRecords.holidayHour}</td>
				<td>${attendanceRecords.resetHour}</td>		
				
				<td>${attendanceRecords.isLate}</td>
				<td>${attendanceRecords.isEarlyLeave}</td>
				<td>${attendanceRecords.isException}</td>
				<td>${attendanceRecords.isAbsent}</td>
						
				<td>
					<fmt:formatDate value="${attendanceRecords.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					${attendanceRecords.remarks}
				</td>
				<shiro:hasPermission name="employee:attendanceRecords:edit"><td>
    				<a href="${ctx}/employee/attendanceRecords/form?id=${attendanceRecords.id}">修改</a>
					<a href="${ctx}/employee/attendanceRecords/delete?id=${attendanceRecords.id}" onclick="return confirmx('确认要删除该考勤结果吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>